﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WpfControlDemo.ViewModels.控件;

namespace WPFCouse
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class LabelWindow : Window
    {
        LabelWindowViewModel vm;

        public LabelWindow()
        {
            InitializeComponent();
            vm =new LabelWindowViewModel();
        }

        private void loginWindow_SourceInitialized(object sender, EventArgs e)
        {
            Console.WriteLine("loginWindow_SourceInitialized");
        }

        private void loginWindow_Activated(object sender, EventArgs e)
        {
            Console.WriteLine("loginWindow_Activated");
        }

        private void loginWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // Console.WriteLine("loginWindow_Loaded");
            //Label的Content对象的获取方式
            string name01 = lblName01.Content.ToString();
            StackPanel sp = lblName02.Content as StackPanel;
            string name02 = (sp.Children[0] as TextBlock).Text + " " + (sp.Children[1] as TextBlock).Text;
        }

        private void loginWindow_ContentRendered(object sender, EventArgs e)
        {
            Console.WriteLine("loginWindow_ContentRendered");
        }

        private void loginWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Console.WriteLine("loginWindow_Closing");
        }

        private void loginWindow_Closed(object sender, EventArgs e)
        {
            Console.WriteLine("loginWindow_Closed");
        }

        private void loginWindow_Deactivated(object sender, EventArgs e)
        {
            Console.WriteLine("loginWindow_Deactivated");
        }
    }
}
